# -*- coding: utf-8 -*-
# author: sixmillions
# date: 2022/4/6
'''
https://dormousehole.readthedocs.io/en/latest/quickstart.html
bash:
export FLASK_APP=flask_demo/p001_quick_start
flask run
或者
python -m flask run
'''
from flask import Flask, escape

app = Flask(__name__)


@app.route('/')
def hello_world():
    return 'Hello World! Flask Quick Start!'


@app.route('/user/<username>')
def show_user_profile(username):
    # show the user profile for that user
    return 'User %s' % escape(username)


@app.route('/post/<int:post_id>')
def show_post(post_id):
    # show the post with the given id, the id is an integer
    return 'Post %d' % post_id


@app.route('/path/<path:subpath>')
def show_subpath(subpath):
    # show the subpath after /path/
    return 'Subpath %s' % escape(subpath)


@app.route('/projects/')
def projects():
    return 'The project page'


@app.route('/about')
def about():
    return 'The about page'
